<?php
if(isset($_GET['op']) && $_GET['op'] =="check")
{
	$account=$_POST["username"];
	$passwd=md5($_POST["passwd"]);
	$sql="SELECT * FROM sys_adminuser WHERE account='{$account}' AND password='{$passwd}'";

	$row=getrecord($sql);
	if($row)
	{	

		$_SESSION['user_info'] =$row;
		unset($row);
		echojson('登录成功', 1, array('url'=>'admht.php?tp=index'));
		die;
	}else{
		echojson('登录失败，帐号或密码错误', 0);
		die;
	}
}
if(isset($_GET['op']) && $_GET['op'] =="out")
{
	session_unset('user_info');
	session_destroy();
	header('Location:admht.php?tp=login');
}

$tpl->display("admht/{$tp}.html");
?>